package cn.wizzer.app.user.modules.services;

import cn.wizzer.app.user.modules.models.RedPacket;
import cn.wizzer.app.user.modules.models.RedPacketRecord;
import cn.wizzer.app.user.modules.models.vo.RedPacketRecordVO;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;

import java.math.BigDecimal;
import java.util.List;

public interface RedPacketRecordService extends BaseService<RedPacketRecord> {
    /**
     * 根据红包生成红包记录
     *
     * @param redPacket
     */
    void generate(RedPacket redPacket);

    /**
     * 根据红包编号正序查询红包记录
     *
     * @param redPacketId
     * @return
     */
    List<RedPacketRecordVO> listByAsc(String redPacketId);

    /**
     * 根据红包编号和用户ID 查询是否抢购红包
     *
     * @param redPacketId
     * @param userId
     * @return
     */
    RedPacketRecordVO fetchByRedIdUserId(String redPacketId, String userId);

    /**
     * 根据红包ID查询已打开的记录
     *
     * @param redPacketId
     * @return
     */
    List<RedPacketRecordVO> listByAscOpened(String redPacketId);


    /**
     * 查询自己收到的红包
     *
     * @param userId
     * @return
     */
    Pagination pageList(String userId, Integer pageNumber, int pageSize);


    /**
     * 后台红包记录列表
     *
     * @param currencyId
     * @param keyword
     * @param searchDate
     * @param pageNumber
     * @param pageSize
     * @return
     */
    Pagination listPage(String conditionData, String currencyId, String keyword, String[] searchDate, int pageNumber, int pageSize);


    /**
     * 根据搜索条件查询
     *
     * @param conditionData
     * @param currencyId
     * @param keyword
     * @param searchDate
     * @return
     */
    BigDecimal searchSum(String conditionData, String currencyId, String keyword, String[] searchDate);
}
